<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" th:replace="~{admin/_inc/_layout::layout(~{::title},~{::link},~{::page_script})}">
<head>
<title>[[#{page.admin_file_manage} +'|'+#{applicationDisplayName}]]</title>
<!-- bootstrap
<link rel="stylesheet" type="text/css" th:href="@{/webjars/bootstrap/3.3.6/css/bootstrap.min.css}"> -->
<!-- datatables -->
<link rel="stylesheet" type="text/css" th:href="@{/webjars/datatables/1.10.20/css/dataTables.bootstrap.css}">
<link rel="stylesheet" type="text/css" th:href="@{/webjars/datatables/1.10.20/css/jquery.dataTables.min.css}">
<link rel="stylesheet" type="text/css" th:href="@{/webjars/framework-ext/1.0.0/datatables/css/dataTables.css}">
<!-- font-awesome -->
<link rel="stylesheet" type="text/css" th:href="@{/webjars/font-awesome/4.7.0/css/font-awesome.min.css}">
<!-- lhgdialog -->
<link rel="stylesheet" type="text/css" th:href="@{/webjars/lhgdialog/4.2.0/skins/bootstrap2.css}">
<link rel="stylesheet" type="text/css" th:href="@{/webjars/framework-ext/1.0.0/datatables/css/dataTables.css}">
</head>
<body>
	<section th:fragment="content">
		<div class="row">
			<div class="col-md-10">
				<div class="box">
					<div class="box-body no-padding">
						<table id="tt" class="table table-bordered" style="width: 100%; white-space: nowrap">
							<tr>
								<th style="width: 20%">标题</th>
								<th style="width: 70%">值</th>
								<th style="width: 10%">操作</th>
							</tr>
							<tr th:each="_item : ${options}">
								<th th:text="${_item.option_tilte}">tilte</th>
								<td><input style="width: 100%" th:id="${_item.option_name}" th:value="${_item.option_value}"><br> <em style="color: #FF3030" th:text="${_item.option_desc}"></em></td>
								<td>
									<button class='btn bg-blue btn-sm' th:data-href="@{/admin/sys_option/save_option}" value="保存" type="button">保存</button>
								</td>
							</tr>
							<tr>
								<th>eg:</th>
								<th>file:///D:/jcrtmp/jackrabbit_test<br>http://localhost:8888/jackrabbit-webapp-2.18.4/server<br>http://localhost:8888/jackrabbit-webapp-2.18.4/rmi
								</th>
								<th></th>
							</tr>
						</table>
					</div>
				</div>
			</div>
		</div>
	</section>
</body>
<script type="text/javascript" charset="UTF-8" th:src="@{/webjars/jquery/1.11.1/jquery.min.js}"></script>
<!-- datatables -->
<script type="text/javascript" charset="UTF-8" th:src="@{/webjars/bootstrap/3.3.6/js/bootstrap.min.js}"></script>
<th:block th:fragment="page_script">
	<script type="text/javascript" charset="UTF-8" th:src="@{/webjars/jquery-validation/1.19.0/jquery.validate.min.js}"></script>
	<script type="text/javascript" charset="UTF-8" th:src="@{/webjars/jquery-validation/1.19.0/additional-methods.min.js}"></script>
	<script type="text/javascript" charset="UTF-8" th:src="@{/webjars/jquery-validation/1.19.0/localization/messages_zh.min.js}"></script>
	<script type="text/javascript" charset="UTF-8" th:src="@{/webjars/datatables/1.10.20/js/jquery.dataTables.min.js}"></script>
	<script type="text/javascript" charset="UTF-8" th:src="@{/webjars/datatables/1.10.20/js/dataTables.bootstrap.min.js}"></script>
	<!-- jquery-framework-ext -->
	<script type="text/javascript" charset="UTF-8" th:src="@{/webjars/framework-ext/1.0.0/jquery/js/jquery-framework-ext.js}"></script>
	<script type="text/javascript" th:inline="javascript">
		var obj = {
			init : function() {
				$('#tt tbody').on('click', '.bg-blue', function(e) {
					$(e.target).prop("disabled", true);
					var val = $(e.target).parents('tr').find('input').val();
					var id = $(e.target).parents('tr').find('input').attr('id');
					$.ajax({
						type : "POST",
						url : $(e.target).data('href'),
						data : {
							option_name : id,
							option_value : val
						},
						complete : function() {
							$(e.target).prop("disabled", false);
						},
						success : function(data) {
							window.location.reload(true);
						},
						error : ajaxerror
					});
				});
			}
		}
		$(function() {
			obj.init();
		})
	</script>
</th:block>
</html>
